package com.xlh.dao.conclude.ext;

import com.xlh.dto.conclude.BusiFullMarkStudentScoreDTO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @author sy
 */
public interface BusiFullMarkMapperExt {


    /**
     * 更新满分项和扣减分项
     * @param courseId
     * @param classIdList
     * @param sysFunkKey
     * @param fullMark
     * @param degression
     */
    void updateFullMark(@Param("courseId") Long courseId,
                        @Param("classIdList") List<Long> classIdList,
                        @Param("sysFunkKey") String sysFunkKey,
                        @Param("fullMark") Integer fullMark,
                        @Param("degression") Integer degression);


    /**
     * 随堂练习平均分数计算
     * @param courseId
     * @param busiType
     * @param classId
     * @param studentId
     * @return
     */
    List<BusiFullMarkStudentScoreDTO> findCoursePracticeAvgScore(@Param("courseId") Long courseId,
                                                                 @Param("busiType") String busiType,
                                                                 @Param("classId") Long classId,
                                                                 @Param("studentId") Long studentId);


    /**
     * 实验平均分数计算
     * @param courseId
     * @param busiType
     * @param classId
     * @param studentId
     * @return
     */
    List<BusiFullMarkStudentScoreDTO> findCourseExperimentAvgScore(@Param("courseId") Long courseId,
                                                                   @Param("busiType") String busiType,
                                                                   @Param("classId") Long classId,
                                                                   @Param("studentId") Long studentId);

    /**
     * 查询练习中最大分值
     * @param chapterId
     * @param classId
     * @return
     */
    Integer findPracticeMaxScore(@Param("chapterId") Long chapterId, @Param("classId") Long classId);


    /**
     * 查询实验中最大分值
     * @param chapterId
     * @param classId
     * @return
     */
    Integer findExperimentMaxScore(@Param("chapterId") Long chapterId, @Param("classId") Long classId);


    /**
     * 查询考试平均分数
     * @param courseId
     * @param studentId
     */
    BusiFullMarkStudentScoreDTO findTestStudentAvgScore(@Param("courseId") Long courseId, @Param("studentId") Long studentId);


    /**
     * 查询更新的最大日期值
     * @param courseId
     * @param sysFunkKey
     * @param classId
     * @return
     */
    Date findMaxUpdateTime(@Param("courseId")Long courseId, @Param("sysFunkKey")String sysFunkKey, @Param("classId")Long classId);


    /**
     * 查询练习的最大更新时间
     * @param studentId
     * @param courseId
     * @return
     */
    Date findMaxPracticeUpdateTime( @Param("studentId") Long studentId,
                                    @Param("courseId") Long courseId,
                                    @Param("sysFunkKey") String sysFunkKey );

    /**
     * 查询报告中满分项中有效的设置最大时间
     * @param studentId
     * @param courseId
     * @param sysFunkKey
     * @return
     */
    Date findMaxReportUpdateTime(Long studentId, Long courseId, String sysFunkKey);



}
